package com.mm.dss.demo;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;


import com.mm.dss.demo.base.BaseActivity;
import com.mm.dss.demo.tools.SharedPreferencedUtils;

import butterknife.BindView;
import butterknife.OnClick;

public class TongzhiInfoActivity extends BaseActivity {
    TextView txt_title,right;
    RelativeLayout layout_back;
    TextView txt_tongzhi;//详情
    String Tlt,Msg,ID;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tongzhi_info);

        if (getIntent().getStringExtra("title")!=null){
            Tlt=getIntent().getStringExtra("title");
            Msg=getIntent().getStringExtra("content");
            ID=getIntent().getStringExtra("ID");
        }

        txt_title= (TextView) findViewById(R.id.txt_title);
        right=(TextView) findViewById(R.id.right);
        layout_back= (RelativeLayout) findViewById(R.id.layout_back);
        txt_tongzhi= (TextView) findViewById(R.id.txt_tongzhi);
        txt_title.setText(Tlt);
        layout_back.setVisibility(View.VISIBLE);
        right.setText("修改");
        if (SharedPreferencedUtils.getString(TongzhiInfoActivity.this,"Level").equals("1")){
            right.setVisibility(View.VISIBLE);
        }else {
            right.setVisibility(View.GONE);
        }
        txt_tongzhi.setText(Msg);
        initdata();
    }

    protected void initdata() {

    }

    public void onclick(View view){
        switch (view.getId()){
            case R.id.layout_back:
                finish();
                break;
            case R.id.right:
                Intent intent=new Intent(TongzhiInfoActivity.this,NewTongZhiActivtity.class);
                intent.putExtra("title",Tlt);
                intent.putExtra("content",Msg);
                intent.putExtra("ID",ID);
                startActivity(intent);
                finish();
                break;
        }
    }
}
